package rsj.sql.statistic;

import com.rlyy.aibase.utils.base.TableNode;
import rsj.annotation.DynamicSelect;
import rsj.annotation.Param;
import rsj.job.statistic.StatisticColumnEntity;
import rsj.job.statistic.StatisticTestUsage;

import java.time.LocalDate;
import java.util.List;

/**
 * 手动执行统计测试环境使用情况
 *
 * @author yuanqinglong
 * @since 2021/6/2 10:51
 */
public interface StatisticTestUsageDao {


    /**
     * 统计测试使用
     *
     * @param statisticsDate 统计日期
     * @param orgId          org id
     * @param cost           1 计费
     * @return {@link TableNode}
     */
    @DynamicSelect(type = StatisticTestUsage.class, method = "statisticalSqlStatement")
    TableNode statisticTestUsage(@Param("statisticsDate") LocalDate statisticsDate, @Param("orgId") String orgId, @Param("cost") String cost);


    /**
     * 添加到sql统计表
     *
     * @param statisticColumnEntities 数据列的实体
     * @param statisticsDate          统计日期
     * @param environment             环境
     * @return int
     */
    @DynamicSelect(type = StatisticTestUsage.class, method = "addToStatisticalTableSql")
    int addToStatisticalTableSql(@Param("statisticColumnEntities") List<StatisticColumnEntity> statisticColumnEntities,
                                 @Param("statisticsDate") LocalDate statisticsDate,
                                 @Param("environment") String environment);
}
